package com.yanqu.road.entity.config.children;

import java.util.ArrayList;
import java.util.List;

public class ChildTrainInfo {

    private int trainType;

    private int needTitle;

    private int earnSpeedAddition;

    private List<Integer> unlockSiteCostList = new ArrayList<>();

    public int getTrainType() {
        return trainType;
    }

    public void setTrainType(int trainType) {
        this.trainType = trainType;
    }

    public int getNeedTitle() {
        return needTitle;
    }

    public void setNeedTitle(int needTitle) {
        this.needTitle = needTitle;
    }

    public int getEarnSpeedAddition() {
        return earnSpeedAddition;
    }

    public void setEarnSpeedAddition(int earnSpeedAddition) {
        this.earnSpeedAddition = earnSpeedAddition;
    }

    public List<Integer> getUnlockSiteCostList() {
        return unlockSiteCostList;
    }

    public void setUnlockSiteCostList(List<Integer> unlockSiteCostList) {
        this.unlockSiteCostList = unlockSiteCostList;
    }

    public int getUnlockSiteCost(int unlockSiteCount){
        if(unlockSiteCount < 1){
            return 0;
        }
        if(unlockSiteCount > unlockSiteCostList.size() ){
            unlockSiteCount = unlockSiteCostList.size();
        }
        return unlockSiteCostList.get(unlockSiteCount - 1);
    }
}
